package com.jhgsys.internal.base.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jhgsys.internal.common.converter.TimeConverter;
import com.jhgsys.internal.common.entity.BaseEntity;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 项目设置 Entity
 *
 * @author Dinghaitao
 * @date 2024-07-29 14:19:15
 */
@Data
@TableName("base_project")
public class BaseProject  extends BaseEntity implements Serializable {

    /**
     * 项目 ID
     */
    @TableId(value = "project_id", type = IdType.ASSIGN_UUID)
    @Size(max = 32, message = "{noMoreThan}")
    private String projectId;

    /**
     * 租户 ID
     */
    @TableField("tenant_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String tenantId;

    /**
     * 项目名称
     */
    @TableField("project_name")
    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    private String projectName;

    /**
     * 项目名称(英文)
     */
    @TableField("project_name_en")
    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    private String projectNameEn;

    /**
     * 项目编号
     */
    @TableField("project_code")
//    @NotBlank(message = "{required}")
    @Size(max = 255, message = "{noMoreThan}")
    private String projectCode;

    /**
     * 排序
     */
    @TableField("sort")
//    @NotNull(message = "{required}")
    private Long sort;

    /**
     * 项目类型;1：修理项目2：建造项目3：内场项目
     */
    @TableField("project_type")
    @Size(max = 2, message = "{noMoreThan}")
    @NotBlank(message = "{required}")
    @ExcelField(value = "项目类型", writeConverterExp = "1=修理项目,2=建造项目,3=内场项目")
    private String projectType;

    /**
     * 开始时间
     */
    @TableField("start_date")
    @NotNull(message = "{required}")
    @ExcelField(value = "开始时间", writeConverter = TimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    /**
     * 结束时间
     */
    @TableField("end_date")
    @NotNull(message = "{required}")
    @ExcelField(value = "结束时间", writeConverter = TimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    /**
     * 项目经理Id
     */
    @TableField("project_manage_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String projectManageId;

    /**
     * 项目经理
     */
    @TableField("project_manage_name")
//    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    private String projectManageName;

    /**
     * 项目经理联系方式
     */
    @TableField("project_manage_phone")
//    @NotBlank(message = "{required}")
    @Size(max = 64, message = "{noMoreThan}")
    private String projectManagePhone;

    /**
     * 安全经理Id
     */
    @TableField("safety_manage_id")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String safetyManageId;

    /**
     * 安全经理
     */
    @TableField("safety_manage_name")
//    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    private String safetyManageName;

    /**
     * 安全经理联系方式
     */
    @TableField("safety_manage_phone")
//    @NotBlank(message = "{required}")
    @Size(max = 64, message = "{noMoreThan}")
    private String safetyManagePhone;

    /**
     * 状态;1：在建 2：已交付
     */
    @TableField("status")
    @NotBlank(message = "{required}")
    @Size(max = 2, message = "{noMoreThan}")
    @ExcelField(value = "状态", writeConverterExp = "1=在建,2=已交付")
    private String status;

}